package delegate

class Site2(map: MutableMap<String, Any?>) {
    val name: String by map
    val url: String by map
}

fun main() {
    val map: MutableMap<String, Any?> = mutableMapOf(
        "name" to "菜鸟教程",
        "url" to "www.runoob.com"
    )

    val site = Site2(map)

    println(site.name)
    println(site.url)

    println("--------------------------------------")

    map["name"] = "大花猫"
    map["url"] = "where.are.you"

    println(site.name)
    println(site.url)

}